﻿@model GitCandy.Models.RepositoryModel

@{
    ViewBag.Title = string.Format(SR.Shared_TitleFormat, string.Format(SR.Repository_DetailTitle, Model.Name));
    var token = GitCandy.Security.Token.Current;
}

<h3>@string.Format(SR.Repository_DetailTitle, Model.Name)</h3>

@if (Model != null)
{
    <dl class="dl-horizontal">

        <dt>@Html.DisplayNameFor(s => s.Name)</dt>
        <dd>@Model.Name</dd>

        <dt>@Html.DisplayNameFor(s => s.IsPrivate)</dt>
        <dd>@Html.DisplayFor(s => s.IsPrivate)</dd>

        <dt>@Html.DisplayNameFor(s => s.AllowAnonymousRead)</dt>
        <dd>@Html.DisplayFor(s => s.AllowAnonymousRead)</dd>

        <dt>@Html.DisplayNameFor(s => s.AllowAnonymousWrite)</dt>
        <dd>@Html.DisplayFor(s => s.AllowAnonymousWrite)</dd>

        <dt>@Html.DisplayNameFor(s => s.DefaultBranch)</dt>
        <dd>@Model.DefaultBranch</dd>

        <dt>@Html.DisplayNameFor(s => s.Description)</dt>
        <dd>@Model.Description</dd>

        <dt>@Html.DisplayNameFor(s => s.Collaborators)</dt>
        <dd>@Html.DisplayFor(s => s.Collaborators)</dd>

        <dt>@Html.DisplayNameFor(s => s.Teams)</dt>
        <dd>@Html.DisplayFor(s => s.Teams)</dd>

        <dt>
            @Html.ActionLink(SR.Repository_Tree, "Tree", new { Model.Name }, new { @class = "btn btn-default pull-left" })
        </dt>
        <dd>
        @if (token != null && (Model.CurrentUserIsOwner || token.IsSystemAdministrator))
        {
            @Html.ActionLink(SR.Shared_Edit, "Edit", new { Model.Name }, new { @class = "btn btn-primary" })
            @:
            @Html.ActionLink(SR.Repository_Relationship, "Coop", new { Model.Name }, new { @class = "btn btn-info" })
        }
        </dd>
    </dl>
}
